package com.sgcc.sx.pmos.e_sx_mall.fragment;

import android.util.Log;
import android.view.View;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.sgcc.sx.pmos.common.base.MvpBaseRecycleFragment;
import com.sgcc.pmos.nativesdk.R;
import com.sgcc.sx.pmos.e_sx_mall.adapter.CurveAdapter;
import com.sgcc.sx.pmos.e_sx_mall.contract.CurveContract;
import com.sgcc.sx.pmos.e_sx_mall.presenter.CurvePresenter;

import java.util.ArrayList;
import java.util.List;

public class CurveFragment extends MvpBaseRecycleFragment<String, CurvePresenter> implements CurveContract.View {

    private static final String TAG = "CurveFragment";

    @Override
    public void querySuccess() {

    }

    @Override
    public void queryFailed() {

    }

    @Override
    protected void initViews() {
        super.initViews();
        refreshLayout.setEnablePureScrollMode(true);
        String tab = getArguments().getString("tab");
        Log.e(TAG, "initViews: tab = " + tab);
    }

    @Override
    protected CurvePresenter createPresenter() {
        return new CurvePresenter();
    }

    @Override
    public BaseQuickAdapter getAdapter() {
        return new CurveAdapter(mContext);
    }

    @Override
    public void getDataRequest(int listSize, boolean isloading) {
        super.getDataRequest(listSize, isloading);
//        mPresenter.getCollectionList(listSize, isloading);

        List<String> list = new ArrayList<>();
        for (int i = 0; i < 2; i++) {
            list.add(i + "");
        }
        loadSuccess(false, list);
    }

    @Override
    public View getFooterLayout(RelativeLayout parent) {
        View footer_view = getLayoutInflater().inflate(R.layout.footer_curve_layout, parent, false);
        findFooterViewByIds(footer_view);
        return footer_view;
    }

    private void findFooterViewByIds(View footer_view) {

    }

}
